//
//  CellDetailTableViewCell.m
//  ToYourHeartNews
//
//  Created by XJing on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥. All rights reserved.
//

#import "CellDetailTableViewCell.h"

@implementation CellDetailTableViewCell
- (void)dealloc
{
    [_picture release];
    [_writerLable release];
    [_contentLable release];
    [_timeLable release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.picture = [[UIImageView alloc]init];
        _picture.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picture];
        [_picture release];
        
        self.writerLable = [[UILabel alloc]init];
//        _writerLable.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:_writerLable];
        [_writerLable release];
        
        self.contentLable = [[UILabel alloc]init];
//        _contentLable.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_contentLable];
        [_contentLable release];
        
        self.timeLable = [[UILabel alloc]init];
//        _readCountLable.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_timeLable];
        [_timeLable release];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.picture.frame = CGRectMake(10, 10, self.contentView.frame.size.width / 5 * 2, self.contentView.frame.size.height - 20);
    self.writerLable.frame = CGRectMake(_picture.frame.origin.x + _picture.frame.size.width + 20, _picture.frame.origin.y, self.contentView.frame.size.width / 5 * 2, 20);
    _writerLable.font = [UIFont systemFontOfSize:12];
    _writerLable.textColor = [UIColor grayColor];
    
    self.contentLable.frame = CGRectMake(_writerLable.frame.origin.x, _writerLable.frame.origin.y + _writerLable.frame.size.height + 5, self.contentView.frame.size.width / 5 * 2, _picture.frame.size.height / 2);
    _contentLable.numberOfLines = 0;
    _contentLable.font = [UIFont systemFontOfSize:16];
    
    self.timeLable.frame = CGRectMake(_writerLable.frame.origin.x, _contentLable.frame.origin.y + _contentLable.frame.size.height + 5, self.contentView.frame.size.width / 2, 20);
    _timeLable.textColor = [UIColor grayColor];
    _timeLable.font = [UIFont systemFontOfSize:15];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
